library(openxlsx)

# 读取数据并指定第一列为行名
a <- read.table(file = "F:/r/dec/ADdata/ADdata1.txt")
b <- read.csv(file = "F:/r/dec/ADdata/ADdata2.csv")
c <- read.xlsx("F:/r/dec/ADdata/ADdata3.xlsx")
d <- read.table(file = "F:/r/dec/ADdata/ADdata4.txt")

rownames(b) <- b[,1]  # 将b的第一列作为行名
b <- b[,-1]           # 移除b的第一列

rownames(c) <- c[,1]  # 将c的第一列作为行名
c <- c[,-1]     

p <- merge(a, b, by = "row.names")
q <- merge(d, c, by = "row.names")
m <- merge(p, q, by = "row.names")
write.csv(m,file ="F:\\r\\dec\\ADdata\\ADdata.csv" )
write.table(m,file ="F:\\r\\dec\\ADdata\\ADdata.txt")
write.xlsx(m,file ="F:\\r\\dec\\ADdata\\ADdata.xlsx")